<template>
  <div class="root">
    <!-- <h2>App - 根组件 </h2>
    <Demo></Demo> -->
    <!-- 5. 路由出口  -->
    <router-view class="page"> </router-view>
  </div>
</template>

<script lang="ts" setup>
import { getCartList } from "./api/api";

import { useDataStore } from "./store/data";

let { setCarNum } = useDataStore();

getCartList().then((res: any) => {
  setCarNum(res.data.cartTotal);
});
</script>